using System;
using NHibernate;

namespace Project.Library.NHibernate
{
    public interface INHUnitOfWork : IDisposable
    {
        /// <summary>
        /// Flushes all the pendent operations in session.
        /// </summary>
        void Flush();

        /// <summary>
        /// Creates an instance of QueryBatcher.
        /// </summary>
        /// <returns></returns>
        IQueryBatcher CreateQueryBatcher();

        /// <summary>
        /// Gets the transaction.
        /// </summary>
        /// <value>The transaction.</value>
        ITransactionManager Transaction { get; }

        /// <summary>
        /// Gets the current session.
        /// </summary>
        /// <returns></returns>
        ISession GetCurrentSession();
    }
}